//
//  FZComposeButton.swift
//  FZSina_Swift
//
//  Created by 李忠 on 7/28/16.
//  Copyright © 2016 FZLZ. All rights reserved.
//

import UIKit

class FZComposeButton: UIButton {

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    var composeButtonInfo: FZComposeButtonInfo?
    

    
    func setupUI() {
        titleLabel?.textAlignment = .Center
        self.adjustsImageWhenHighlighted = false
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        imageView?.frame.origin.x = 0
        imageView?.frame.origin.y = 0
        imageView?.frame.size.width = self.frame.width
        imageView?.frame.size.height = self.frame.width
        
        titleLabel?.frame.origin.x = 0
        titleLabel?.frame.origin.y = self.frame.width
        titleLabel?.frame.size.width = self.frame.width
        titleLabel?.frame.size.height = self.frame.height - self.frame.width
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}
